<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:ui="http://xmlns.jcp.org/jsf/facelets"
      xmlns:h="http://xmlns.jcp.org/jsf/html"
      xmlns:f="http://xmlns.jcp.org/jsf/core">

    <ui:composition template="/template.xhtml">
        <ui:define name="title">
            <h:outputText value="#{mensagens.EditFilmeTitle}"></h:outputText>
        </ui:define>
        <ui:define name="body">
            <h:panelGroup id="messagePanel" layout="block">
                <h:messages errorStyle="color: red" infoStyle="color: green" layout="table"/>
            </h:panelGroup>
            <h:form>
                <h:panelGrid columns="2">
                    <h:outputLabel value="#{mensagens.EditFilmeLabel_idFilme}" for="idFilme" />
                    <h:inputText id="idFilme" value="#{filmeController.selected.idFilme}" title="#{mensagens.EditFilmeTitle_idFilme}" required="true" requiredMessage="#{mensagens.EditFilmeRequiredMessage_idFilme}"/>
                    <h:outputLabel value="#{mensagens.EditFilmeLabel_titulo}" for="titulo" />
                    <h:inputText id="titulo" value="#{filmeController.selected.titulo}" title="#{mensagens.EditFilmeTitle_titulo}" />
                    <h:outputLabel value="#{mensagens.EditFilmeLabel_capa}" for="capa" />
                    <h:inputTextarea rows="4" cols="30" id="capa" value="#{filmeController.selected.capa}" title="#{mensagens.EditFilmeTitle_capa}" />
                    <h:outputLabel value="#{mensagens.EditFilmeLabel_duracao}" for="duracao" />
                    <h:inputText id="duracao" value="#{filmeController.selected.duracao}" title="#{mensagens.EditFilmeTitle_duracao}" />
                    <h:outputLabel value="#{mensagens.EditFilmeLabel_descricao}" for="descricao" />
                    <h:inputTextarea rows="4" cols="30" id="descricao" value="#{filmeController.selected.descricao}" title="#{mensagens.EditFilmeTitle_descricao}" />
                    <h:outputLabel value="#{mensagens.EditFilmeLabel_preco}" for="preco" />
                    <h:inputText id="preco" value="#{filmeController.selected.preco}" title="#{mensagens.EditFilmeTitle_preco}" required="true" requiredMessage="#{mensagens.EditFilmeRequiredMessage_preco}"/>
                    <h:outputLabel value="#{mensagens.EditFilmeLabel_midiaIdMidia}" for="midiaIdMidia" />
                    <h:selectOneMenu id="midiaIdMidia" value="#{filmeController.selected.midiaIdMidia}" title="#{mensagens.EditFilmeTitle_midiaIdMidia}" required="true" requiredMessage="#{mensagens.EditFilmeRequiredMessage_midiaIdMidia}">
                        <f:selectItems value="#{midiaController.itemsAvailableSelectOne}"/>
                    </h:selectOneMenu>
                    <h:outputLabel value="#{mensagens.EditFilmeLabel_categoriaIdCategoria}" for="categoriaIdCategoria" />
                    <h:selectOneMenu id="categoriaIdCategoria" value="#{filmeController.selected.categoriaIdCategoria}" title="#{mensagens.EditFilmeTitle_categoriaIdCategoria}" required="true" requiredMessage="#{mensagens.EditFilmeRequiredMessage_categoriaIdCategoria}">
                        <f:selectItems value="#{categoriaController.itemsAvailableSelectOne}"/>
                    </h:selectOneMenu>
                </h:panelGrid>
                <h:commandLink action="#{filmeController.update}" value="#{mensagens.EditFilmeSaveLink}"/>
                <br />
                <br />
                <h:link outcome="View" value="#{mensagens.EditFilmeViewLink}"/>
                <br />
                <h:commandLink action="#{filmeController.prepareList}" value="#{mensagens.EditFilmeShowAllLink}" immediate="true"/>
                <br />
                <br />
                <h:link outcome="/index" value="#{mensagens.EditFilmeIndexLink}" />
            </h:form>
        </ui:define>
    </ui:composition>

</html>
